import { PageReq, PageRes } from '@/api/types'
import request from '@/utils/request'

// 获取预算列表
export function budgetPageApi(data: PageReq<Partial<any>>) {
  return request<PageRes<any>>({
    url: '/budget/page',
    method: 'post',
    data
  })
}

// 新增预算
export function addBudgetApi(data: any) {
  return request({
    url: '/budget/add',
    method: 'post',
    data
  })
}

// 更新预算
export function editBudgetApi(data: any) {
  return request({
    url: '/budget/edit',
    method: 'post',
    data
  })
}

// 删除预算
export function delBudgetApi(data: { id: number }) {
  return request({
    url: '/budget/del',
    method: 'post',
    data
  })
}

// 获取预算列表
export function getBudgetListApi(data: { isUse: boolean; orgId: number }) {
  return request({
    url: '/budget/getBudgetList',
    method: 'post',
    data
  })
}
